package com.jc.constant;

public enum TransportModeEnum {
    SEA("1", "海运"),
    AIR("2", "空运"),
    LAND("3", "陆运"),
    SEA_LAND("4", "海陆联运");

    private final String code;
    private final String name;

    TransportModeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static TransportModeEnum getByCode(String code) {
        for (TransportModeEnum item : TransportModeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}